package com.qc.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qc.dao.OrderDao;
import com.qc.entity.OrderAlipayCallBackEntity;
import com.qc.entity.OrderBillEntity;
import com.qc.entity.OrderCommentEntity;
import com.qc.entity.OrderEntity;
import com.qc.entity.OrderEntityVo;
import com.qc.entity.OrderScheduleEntity;
import com.qc.entity.info.MyOrderInfo;
import com.qc.service.OrderService;

@Service
public class OrderServiceImpl implements OrderService {

	@Resource
	OrderDao orderDao;

	@Override
	public long addOrder(OrderEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.addOrder(entity);
	}

	@Override
	public OrderEntity getOrderByOrderNumber(String orderNumber) {
		// TODO Auto-generated method stub
		return orderDao.getOrderByOrderNumber(orderNumber);
	}

	@Override
	public long updateOrderIsPay(long orderId, int payType) {
		// TODO Auto-generated method stub
		return orderDao.updateOrderIsPay(orderId, payType);
	}

	@Override
	public long addOrderPayLog(OrderAlipayCallBackEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.addOrderPayLog(entity);
	}

	@Override
	public long addOrderBill(OrderBillEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.addOrderBill(entity);
	}

	@Override
	public List<OrderEntity> getAllMyOrder(MyOrderInfo orderInfo, long userId) {
		// TODO Auto-generated method stub
		return orderDao.getAllMyOrder(orderInfo, userId);
	}

	@Override
	public long updateOrderState(int orderState,long orderId) {
		// TODO Auto-generated method stub
		return orderDao.updateOrderState(orderState,orderId);
	}

	@Override
	public OrderEntity getBothOrderInfo(OrderEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.getBothOrderInfo(entity);
	}

	@Override
	public long addOrderSchedule(OrderScheduleEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.addOrderSchedule(entity);
	}

	@Override
	public List<OrderScheduleEntity> getScheduleByOrderIdAndDate(OrderScheduleEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.getScheduleByOrderIdAndDate(entity);
	}

	@Override
	public long cancelOrder(long orderId) {
		// TODO Auto-generated method stub
		return orderDao.cancelOrder(orderId);
	}

	@Override
	public long addOrderComment(OrderCommentEntity entity) {
		// TODO Auto-generated method stub
		return orderDao.addOrderComment(entity);
	}

	@Override
	public long updateOrderIsComment(long orderId) {
		// TODO Auto-generated method stub
		return orderDao.updateOrderIsComment(orderId);
	}

	@Override
	public List<OrderCommentEntity> getOrderCommentByOrderId(long orderId) {
		// TODO Auto-generated method stub
		return orderDao.getOrderCommentByOrderId(orderId);
	}

	@Override
	public OrderEntity getOrderDetailByOrderId(long orderId) {
		// TODO Auto-generated method stub
		return orderDao.getOrderDetailByOrderId(orderId);
	}

    @Override
    public int getListOrderCount(String bNickName, String mNickName,
            String orderNumber,String orderState,String isPay) {

        return orderDao.getListOrderCount(bNickName, mNickName, orderNumber,orderState,isPay);
    }

    @Override
    public List getAllOrder(String bNickName, String mNickName,
            String orderNumber,String orderState,String isPay, int pageNo, int pageSize) {

        return orderDao.getAllOrder(bNickName, mNickName, orderNumber,orderState,isPay, pageNo, pageSize);
    }

    @Override
    public OrderEntityVo getOrderId(String orderId) {

        return orderDao.getOrderId(orderId);
    }

    @Override
    public List getOrderScheduleId(String orderId) {

        return orderDao.getOrderScheduleId(orderId);
    }

	@Override
	public List<OrderEntity> getSecretaryBySecUserId(long userId) {
		return orderDao.getSecretaryBySecUserId(userId);
	}

    @Override
    public List<OrderScheduleEntity> getAllOrderByDate(String startTime, String endTime) {

        return orderDao.getAllOrderByDate(startTime,endTime);
    }

    @Override
    public List<OrderEntity> getAllOrderTime(String startDate, String endDate) {

        return orderDao.getAllOrderTime(startDate, endDate);
    }

    @Override
    public void updateOrderState(String orderId, String orderState) {

        orderDao.updateOrderState(orderId, orderState);
    }

	@Override
	public void updateOrderSchedulePush(long orderScheduleId) {
		orderDao.updateOrderSchedulePush(orderScheduleId);
	}
}
